package com.zxx.pattern.prototypePattern.prototype;

import androidx.annotation.NonNull;

/**
 * @author zxx on 2020/12/18
 */
public class Shape implements Cloneable {

    protected String type;

    @NonNull
    @Override
    protected Object clone() {
        Shape shape = null;
        try {
            shape = (Shape) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return shape;
    }

    public void introduce() {
        System.out.println("This is a " + type);
    }

}
